Beginning Windows Phone App Development by Henry Lee & Eugene Chuvyrov
Author:Henry Lee & Eugene Chuvyrov
Language: eng
Format: epub
Publisher: Apress®
Published: 2011-03-10T16:00:00+00:00
Using Culture Settings with ToString to Display Dates, Times, and Text
To see how you can go about preparing an application for the world, you'll build a simple application that announces a new product—in this case the latest release of Windows Phone. But first you will learn how to use the CultureInfo class to ensure that dates, numbers, and text appear in the right form regardless of the culture in which the announcement is made. Then you'll see how, by using resource (.resx) files, you can easily add translated content to your app to reach new markets.
Let's jump into the code that will set the stage for discussing internationalization of Windows Phone applications.
Start by creating a new project inside Visual Studio and naming it InternationalizationSample. By default, the MainPage.xaml file is created in the development environment, with the designer and XAML windows open and ready to program.
Double-click MainPage.xaml to bring up the XAML designer window. For convenience and simplicity, you will alter the content of the TextBlocks in the TitleGrid block. Make the XAML of TitleGrid look identical to the XAML here: <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12">
<TextBlock x:Name="ApplicationTitle" Text="Current Culture Setting" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="culture" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
Your project should now look like Figure 12-1. So far you've simply changed the text of the default title TextBlock in the Windows Phone application.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(14993)
The Mikado Method by Ola Ellnestam Daniel Brolund(12251)
Hello! Python by Anthony Briggs(12147)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(11527)
Dependency Injection in .NET by Mark Seemann(11307)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10528)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(10125)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(9776)
Grails in Action by Glen Smith Peter Ledbrook(9453)
Hit Refresh by Satya Nadella(9039)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(9001)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(9000)
The Kubernetes Operator Framework Book by Michael Dame(8473)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(8423)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8298)
Robo-Advisor with Python by Aki Ranin(8248)
Practical Computer Architecture with Python and ARM by Alan Clements(8224)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(8193)
Building Low Latency Applications with C++ by Sourav Ghosh(8098)